#include <fstream>

#include "../lib/nlohmann/json.hpp"

#include "colors.hpp"

#ifndef _JSON_WRITER_HPP_
#define _JSON_WRITER_HPP_

namespace alexcr4ckpentest
{
  class JsonWriter
  {
  public:
    JsonWriter() noexcept;
    JsonWriter(const std::string& filename);

    JsonWriter(const JsonWriter&) = delete;
    JsonWriter& operator=(const JsonWriter&) = delete;

    ~JsonWriter() noexcept;

    inline void set_filename(const std::string& new_filename) noexcept
    { m_filename = new_filename; }

    void write(const nlohmann::json& json_format_text) noexcept;

  private:
    std::string m_filename;
    std::ofstream m_out_file_stream;
  };
}

#endif // _JSON_WRITER_HPP_
